package com.cta.tcp.server;

import java.io.IOException;

import javax.jms.JMSException;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.cta.jms.MessageProducer;

/**
 * Hello world!
 * 
 */
public class App {
	public static ApplicationContext context;

	public static void main(String[] args) throws IOException, InterruptedException, JMSException {
		context = new ClassPathXmlApplicationContext("applicationContext.xml");
		//TCPServer tcpServer = context.getBean("tcpServer", TCPServer.class);
		//tcpServer.initServer();
		//just test data
		MessageProducer producer = context.getBean("producerService", MessageProducer.class);
		/*while(true){
			Thread.sleep(1000);
			producer.sendMessages(TestingService.getData());
		}*/
		
		TestingService.sentDataFromfile(producer);
	}
}
